package com.huahang.fashionpress.service.impl;

import com.huahang.fashionpress.form.FormUser;
import com.huahang.fashionpress.mapper.UserMapper;
import com.huahang.fashionpress.model.User;
import com.huahang.fashionpress.service.ILonginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "loginServiceImpl")
public class LonginServiceImpl implements ILonginService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public int checkUser(FormUser formUser) throws LonginExcption {
        //根据用户名从数据库中找到user对象
        User user = userMapper.selectByUsername(formUser.getUserUsername());
        //如果返回空用户，则抛出用户名错误异常
        if(user == null){
            throw new LoginExcption
        }
        if(!user.getUserPassword().equals(formUser.getUserPassword()))

    }
}
